<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {:widget_st('layui','css')}
  {:widget_st('jq','js')}
  {:widget_st('layui','js')}  
  {:widget_st('common','js')} 
  {:widget_st('autosize')} 
  
</head>
{:do_action('admin_head')}
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <?php $form_widget = new \app\common\widget\FormPro();  ?>
      <form method="post" class="info_tj" >
        <input type="hidden" name="id" value="{$res.id}">
        <div class="layui-col-sm12">
          <div class="layui-row layui-col-space15">
              <div class="layui-col-sm9">
                <div class="layui-card">
                  {$form_widget->form_textarea(['title'=>'键','name'=>'key','data'=>$res['key'],'theme'=>1])|raw}
                  {$form_widget->form_textarea(['title'=>'值','name'=>'value','data'=>$res['value'],'theme'=>1])|raw}
                  {$form_widget->form_textarea(['title'=>'备注','name'=>'msg','data'=>$res['msg'],'theme'=>1])|raw}
                <br>
                </div>
                
                
              </div>
              <div class="layui-col-sm3">
                
                <div class="layui-card">
                  {$form_widget->form_select(['title'=>'父类','name'=>'type','data'=>$res['type'],'id_t'=>'id', 'name_t'=>'name','list_arr'=>[['id'=>'user','name'=>'用户'],['id'=>'system','name'=>'系统'],['id'=>'addons','name'=>'插件']],'theme'=>3])|raw}

                  {$form_widget->form_input(['title'=>'排序','name'=>'sort','data'=>$res['sort'],'theme'=>1])|raw}
                  
                  {$form_widget->form_radio(['title'=>'状态','name'=>'status','data'=>$res['status'],'theme'=>1])|raw}


                </div>
                
                {include file="public/widget_submit"}

              </div>
          </div>
        </div>
      </form>
        
      </div>
    </div>
  </div>
  


  <script>

 layui.use(['form'], function(){
    var $ = layui.$
    ,element = layui.element
    ,form = layui.form;


      $('.tijiao').on("click",function(){
          var index = layer.load(2);
          var data = $(".info_tj input,.info_tj select,.info_tj textarea,.info_tj radio").serialize();      
          $.ajax({
              type:'post',
              url:"{:url('config/custom_config_edit')}",//
              data:data,
              dataType:'json',
              success:function(res){
                if(res.result==1){
                  layer.msg(res.msg, {icon: 1});
                  setTimeout(function() {
                      if(res.msg.code==1){
                        window.location.reload();
                      }else{
                        window.parent.location.reload();
                      }
                  }, 2000);
                }else{
                  layer.close(index);
                  layer.msg(res.msg, {icon: 2});
                }   
              }
          })
      })


  });
autosize(document.querySelectorAll('textarea'));

  </script>
</body>
</html>
{:do_action('admin_js')}

